package com.ss.android.article.browser.view.a;

import android.graphics.Rect;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView.ItemDecoration;
import android.support.v7.widget.RecyclerView.State;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.bytedance.common.utility.UIUtils;

public final class a extends ItemDecoration {
    private int a;
    private boolean b;
    private int c;

    public a(int arg1) {

        this.c = arg1;
    }

    public final void getItemOffsets(Rect arg5, View arg6, RecyclerView arg7, State arg8) {
        if(!this.b) {
            int v1 = UIUtils.getScreenWidth(arg7.getContext());
            int v2 = arg6.getMeasuredWidth();
            int v0 = ((GridLayoutManager)arg7.getLayoutManager()).getSpanCount();
            this.a = (v1 - v2 * v0) / (v0 << 2);
            this.b = true;
        }

        arg5.set(this.a, this.a / this.c, this.a / 2, 0);
    }
}

